In a communications device, to adapt to different heights of electronic devices on a board inside a product, an upper cover and a bottom shell are provided with many raised structures, and the electronic devices need to dissipate heat by clinging to the shell. Because the devices need to uniformly dissipate heat by clinging to the shell on a same plane, a certain clearance tolerance is caused. Due to this clearance tolerance, a heat conducting material having a large thickness needs to be coated on a surface of a device, to conduct heat to an enclosure for heat dissipation. In the field of optical communications, many products use optical modules for data transmission. An optical module, for example, a transmitter optical subassembly (TOSA), is installed between an upper cover and a bottom shell. A high density of the optical module causes a relatively large gap between the optical module and the upper cover or the bottom shell, and a heat conducting material is needed to fill the gap. Because the heat conducting material also has a very large thermal resistance, a heat dissipation requirement of the optical module cannot be well satisfied, reducing the service life of the optical module.